/**
 * Project Name:sc-parent-service
 * File Name:AnnualincomeProbabilityImpl.java
 * Package Name:com.sc.probability.impl
 * Date:2018年6月28日下午10:46:57
 * Copyright (c) 2018, bluemobi All Rights Reserved.
 */

package com.sc.probability.impl;

import com.sc.pojo.Customer;
import com.sc.probability.Probability;

/**
 * Description:计算年收入的概率 <br/>
 * Date:     2018年6月28日 下午10:46:57 <br/>
 * @author   tianyongxu
 * @version
 * @see
 */
public class AnnualincomeProbabilityImpl implements Probability {

    @Override
    public float getProbability(Customer customer) {
         float annualincomeProbability = 0.0f;
        if (customer.getCannualincome() != null) {
            if (customer.getCannualincome() < 20) {
                annualincomeProbability = 0.01f;
            }if (customer.getCannualincome() < 30) {
                annualincomeProbability = 0.05f;
            }if (customer.getCannualincome() < 40) {
                annualincomeProbability = 0.1f;
            }if (customer.getCannualincome() < 50) {
                annualincomeProbability = 0.2f;
            }if (customer.getCannualincome() < 60) {
                annualincomeProbability = 0.3f;
            }if (customer.getCannualincome() < 100) {
                annualincomeProbability = 0.4f;
            }
        }
        return annualincomeProbability;
    }

}

